home *** CD-ROM | disk | FTP | other *** search
- property spritenum, spriteLoc, currMemberNum, cleanup, ancestor, killList, hotspotList
-
- on new me, parameterList
- set killList to []
- set hotspotList to []
- set spritenum to getProp(parameterList, #spritenum)
- set cleanup to getProp(parameterList, #cleanup)
- set currMemberNum to 0
- set spriteLoc to the loc of sprite spritenum
- puppetSprite(spritenum, 1)
- set the locV of sprite spritenum to -1000
- set the movieRate of sprite spritenum to 0
- set the movieTime of sprite spritenum to 1
- set the stageColor to the stageColor
- updateStage()
- set the visible of sprite spritenum to 1
- updateStage()
- set controlSprite to getaProp(parameterList, #playSprite)
- if controlSprite > 0 then
- repeat with control in [#play, #stop, #slow, #fwdframe, #backframe]
- set button to BasicButton(me, [#hotSprites: [controlSprite]])
- AddDown(button, NewObject(me, "Video Control Class", [#videoControl: control, #videoDisplay: me]))
- set controlSprite to controlSprite + 1
- end repeat
- end if
- return me
- end
-
- on init me, newVidMember
- put "Init video" && newVidMember
- set audioController to the audioController of GetGlobal(#gTitleObject)
- SuspendAudio(audioController)
- if newVidMember <= 0 then
- put "Bad video member"
- stop(me)
- set the stageColor to the stageColor
- updateStage()
- else
- set currMemberNum to newVidMember
- set the loc of sprite spritenum to spriteLoc
- set the memberNum of sprite spritenum to currMemberNum
- set the visible of sprite spritenum to 1
- set the movieRate of sprite spritenum to 0
- set the movieTime of sprite spritenum to 1
- set the stageColor to the stageColor
- updateStage()
- play(me)
- end if
- end
-
- on play me
- put "Play"
- set audioController to the audioController of GetGlobal(#gTitleObject)
- SuspendAudio(audioController)
- if currMemberNum > 0 then
- set the movieRate of sprite spritenum to 1
- updateStage()
- put "Playing movie" && the name of member the memberNum of sprite spritenum
- else
- put "No video to play"
- end if
- end
-
- on slow me
- put "Slow"
- set audioController to the audioController of GetGlobal(#gTitleObject)
- SuspendAudio(audioController)
- if currMemberNum > 0 then
- set the movieRate of sprite spritenum to 0.5
- updateStage()
- else
- put "No video to play"
- end if
- end
-
- on stop me
- put "Stop"
- if currMemberNum > 0 then
- set the movieRate of sprite spritenum to 0
- if cleanup then
- set the locV of sprite spritenum to -1000
- end if
- set the stageColor to the stageColor
- updateStage()
- else
- put "No video to play"
- end if
- set audioController to the audioController of GetGlobal(#gTitleObject)
- ResumeAudio(audioController)
- end
-
- on fwdframe me
- put "FwdFrame"
- if currMemberNum > 0 then
- set the movieRate of sprite spritenum to 0
- set newTime to the movieTime of sprite spritenum + 3
- set endTime to the duration of member currMemberNum
- if newTime < 1 then
- set newTime to 1
- end if
- if newTime > endTime then
- set newTime to endTime
- end if
- set the movieTime of sprite spritenum to newTime
- updateStage()
- else
- put "No video to play"
- end if
- end
-
- on backframe me
- put "BackFrame"
- if currMemberNum > 0 then
- set the movieRate of sprite spritenum to 0
- set newTime to the movieTime of sprite spritenum - 3
- set endTime to the duration of member currMemberNum
- if newTime < 1 then
- set newTime to 1
- end if
- if newTime > endTime then
- set newTime to endTime
- end if
- set the movieTime of sprite spritenum to newTime
- updateStage()
- else
- put "No video to play"
- end if
- end
-
- on rewind me
- put "rewind"
- set the movieRate of sprite spritenum to 0
- set the movieTime of sprite spritenum to 1
- updateStage()
- end
-
- on clear me
- put "clear video"
- stop(me)
- updateStage()
- end
-
- on CheckIdle me
- if the movieRate of sprite spritenum = 0 then
- if cleanup then
- set the locV of sprite spritenum to -1000
- end if
- set the stageColor to the stageColor
- updateStage()
- set audioController to the audioController of GetGlobal(#gTitleObject)
- ResumeAudio(audioController)
- end if
- end
-
- on dispose me
- put "dispose Video Display Class" && me
- stop(me)
- set currMemberNum to 0
- set the memberNum of sprite spritenum to currMemberNum
- puppetSprite(spritenum, 0)
- set hotspotList to []
- set spriteLoc to 0
- ClearObjectList(killList)
- set killList to []
- if objectp(ancestor) then
- dispose(ancestor)
- end if
- set ancestor to 0
- end
-